<template>
  <view class="setting">
    <view class="setting-item" @click="toXiyiPage('sys_about_us')">
      <view class="label">
        关于我们
      </view>
      <image class="arrow" src="../../static/images/arrow.png" mode=""></image>
    </view>
    <view class="setting-item" @click="delAccount">
      <view class="label">
        注销账号
      </view>
      <image class="arrow" src="../../static/images/arrow.png" mode=""></image>
    </view>
    <view class="setting-item">
      <view class="label">
        版本
      </view>
      <view class="txt">{{version_number}}</view>
      <image class="arrow" src="../../static/images/arrow.png" mode=""></image>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        version_number: ""
      }
    },
    onShow() {
      // 条件编译，只在APP渲染
      const systemInfo = uni.getSystemInfoSync();
      // #ifdef APP
      this.version_number = systemInfo.appWgtVersion;
      // #endif
    },
    methods: {
      // 协议
      toXiyiPage(type) {
        uni.navigateTo({
          url: `/pages/mine/aboutUs?type=${type}`
        })
      },
      // 认证信息
      authInfo() {
        uni.navigateTo({
          url: `/pages/home/authEnd`
        })
      },
      // 注销账号
      delAccount() {
        console.log("点击了注销");
        uni.navigateTo({
          url: `/pages/mine/logOut`
        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  .setting {
    background: #fff;

    .setting-item {
      padding: 0 40rpx;
      box-sizing: border-box;
      height: 108rpx;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 2rpx solid #eee;

      .label {
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 28rpx;
        color: #333333;
      }

      .txt {
        flex: 1;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 28rpx;
        color: #333333;
        text-align: right;
      }

      .arrow {
        width: 40rpx;
        height: 40rpx;
      }
    }
  }
</style>